package person.learn.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import person.learn.entity.User;
import person.learn.repository.UserRepository;
import person.learn.service.UserService;
import person.learn.service.base.BaseService;

/**
 * Created by barton on 16-2-3.
 */
@Service
public class UserServiceImpl extends BaseService<User> implements UserService {

    @Autowired
    private UserRepository userRepository;

    @Override
    public User findByUserName(String userName) {
        return this.userRepository.findByUserName(userName);
    }

    @Override
    public void add(User user) {
        this.userRepository.save(user);
    }

    @Override
    public UserRepository getRepository() {
        return userRepository;
    }
}
